package org.appfuse.model;

import org.apache.commons.lang.builder.CompareToBuilder;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;

/**
 * @struts.form include-all="true" extends="org.appfuse.webapp.form.BaseForm"
 * @hibernate.class table="Menu"
 */
public class Menu  extends BaseObject  implements Comparable{
	/*
	 * CREATE TABLE menu_item (
	 *  id number not null, 
	 *  parent_name VARCHAR(30),
	 * name VARCHAR(30), 
	 * title VARCHAR(30), 
	 * description VARCHAR(50), 
	 * location  VARCHAR(255), 
	 * target VARCHAR(10), 
	 * onclick VARCHAR(100), 
	 * onmouseover VARCHAR(100), 
	 * onmouseout VARCHAR(100), 
	 * image VARCHAR(50),
	 * altImage  VARCHAR(30), 
	 * tooltip VARCHAR(100), 
	 * roles VARCHAR(100), 
	 * page VARCHAR(255),
	 * width VARCHAR(5), 
	 * height VARCHAR(5), 
	 * forward VARCHAR(50), 
	 * action VARCHAR(50), 
	 * primary key (id) )
	 */

	/**
	 * 
	 */
	private static final long serialVersionUID = 8055228723124307457L;

	private Long id;

	private String parentName;

	private String name;

	private String title;

	private String description;
	
	private String location;

	private String target;

	private String onClick;

	private String onMouseOver;

	private String onMouseOut;

	private String image;

	private String altImage;

	private String tooltip;

	private String roles;

	private String page;

	private String width;

	private String height;

	private String forward;

	private String action;

	/**
	 * @hibernate.property column="action" length="50"
	 * @return
	 */
	public String getAction() {
		return action;
	}

	public void setAction(String action) {
		this.action = action;
	}

	/**
	 * @hibernate.property column="altimage" length="50"
	 * @return
	 */
	public String getAltImage() {
		return altImage;
	}

	public void setAltImage(String altImage) {
		this.altImage = altImage;
	}

	/**
	 * @hibernate.property column="description" length="100"
	 * @return
	 */
	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	/**
	 * @hibernate.property column="forward" length="100"
	 * @return
	 */
	public String getForward() {
		return forward;
	}

	public void setForward(String forward) {
		this.forward = forward;
	}

	/**
	 * @hibernate.property column="height" length="10"
	 * @return
	 */
	public String getHeight() {
		return height;
	}

	public void setHeight(String height) {
		this.height = height;
	}

    /**
     * @hibernate.id column="id" generator-class="increment" unsaved-value="null"
     */
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

    /**
     * @hibernate.property column="image" length="50"
     */
	public String getImage() {
		return image;
	}

	public void setImage(String image) {
		this.image = image;
	}

	/**
	 * @hibernate.property column="name" length="50"
	 */
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @hibernate.property column="onclick" length="100"
	 */
	public String getOnClick() {
		return onClick;
	}

	public void setOnClick(String onClick) {
		this.onClick = onClick;
	}

	/**
	 * @hibernate.property column="onmouseout" length="100"
	 */
	public String getOnMouseOut() {
		return onMouseOut;
	}

	public void setOnMouseOut(String onMouseOut) {
		this.onMouseOut = onMouseOut;
	}

	/**
	 * @hibernate.property column="onmouseover" length="100"
	 */
	public String getOnMouseOver() {
		return onMouseOver;
	}

	public void setOnMouseOver(String onMouseOver) {
		this.onMouseOver = onMouseOver;
	}

	/**
	 * @hibernate.property column="page" length="100"
	 */
	public String getPage() {
		return page;
	}

	public void setPage(String page) {
		this.page = page;
	}

	/**
	 * @hibernate.property column="parentname" length="50"
	 */
	public String getParentName() {
		return parentName;
	}

	public void setParentName(String parentName) {
		this.parentName = parentName;
	}

	/**
	 * @hibernate.property column="roles" length="50"
	 */
	public String getRoles() {
		return roles;
	}

	public void setRoles(String roles) {
		this.roles = roles;
	}

	/**
	 * @hibernate.property column="target" length="100"
	 */
	public String getTarget() {
		return target;
	}

	public void setTarget(String target) {
		this.target = target;
	}

	/**
	 * @hibernate.property column="title" length="50"
	 */
	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	/**
	 * @hibernate.property column="tooltip" length="50"
	 */
	public String getTooltip() {
		return tooltip;
	}

	public void setTooltip(String tooltip) {
		this.tooltip = tooltip;
	}

	/**
	 * @hibernate.property column="width" length="50"
	 */
	public String getWidth() {
		return width;
	}

	public void setWidth(String width) {
		this.width = width;
	}

	/**
	 * @see java.lang.Comparable#compareTo(Object)
	 */
	public int compareTo(Object object) {
		Menu myClass = (Menu) object;
		return new CompareToBuilder().append(this.action, myClass.action)
				.append(this.width, myClass.width).append(this.title,
						myClass.title).append(this.target, myClass.target)
				.append(this.tooltip, myClass.tooltip).append(this.onMouseOut,
						myClass.onMouseOut).append(this.altImage,
						myClass.altImage).append(this.roles, myClass.roles)
				.append(this.parentName, myClass.parentName).append(this.id,
						myClass.id).append(this.onMouseOver,
						myClass.onMouseOver).append(this.forward,
						myClass.forward).append(this.height, myClass.height)
				.append(this.page, myClass.page).append(this.description,
						myClass.description).append(this.image, myClass.image)
				.append(this.onClick, myClass.onClick).append(this.name,
						myClass.name).toComparison();
	}

	/**
	 * @see java.lang.Object#equals(Object)
	 */
	public boolean equals(Object object) {
		if (!(object instanceof Menu)) {
			return false;
		}
		Menu rhs = (Menu) object;
		return new EqualsBuilder().append(
				this.action, rhs.action).append(this.width, rhs.width).append(
				this.title, rhs.title).append(this.target, rhs.target).append(
				this.tooltip, rhs.tooltip).append(this.onMouseOut,
				rhs.onMouseOut).append(this.altImage, rhs.altImage).append(
				this.roles, rhs.roles).append(this.parentName, rhs.parentName)
				.append(this.id, rhs.id).append(this.onMouseOver,
						rhs.onMouseOver).append(this.forward, rhs.forward)
				.append(this.height, rhs.height).append(this.page, rhs.page)
				.append(this.description, rhs.description).append(this.image,
						rhs.image).append(this.onClick, rhs.onClick).append(
						this.name, rhs.name).isEquals();
	}

	/**
	 * @see java.lang.Object#hashCode()
	 */
	public int hashCode() {
		return new HashCodeBuilder(1950531667, 2088968965).append(this.action).append(this.width)
				.append(this.title).append(this.target).append(this.tooltip)
				.append(this.onMouseOut).append(this.altImage).append(
						this.roles).append(this.parentName).append(this.id)
				.append(this.onMouseOver).append(this.forward).append(
						this.height).append(this.page).append(this.description)
				.append(this.image).append(this.onClick).append(this.name)
				.toHashCode();
	}

	/**
	 * @see java.lang.Object#toString()
	 */
	public String toString() {
		return new ToStringBuilder(this).append("altImage", this.altImage)
				.append("forward", this.forward).append("page", this.page)
				.append("action", this.action).append("id", this.id).append(
						"roles", this.roles).append("height", this.height)
				.append("onMouseOver", this.onMouseOver).append("onMouseOut",
						this.onMouseOut).append("tooltip", this.tooltip)
				.append("name", this.name).append("onClick", this.onClick)
				.append("description", this.description).append("image",
						this.image).append("width", this.width).append("title",
						this.title).append("parentName", this.parentName)
				.append("target", this.target).toString();
	}

	/**
	 * @hibernate.property column="location" length="255"
	 * @return
	 */
	public String getLocation() {
		return location;
	}

	public void setLocation(String location) {
		this.location = location;
	}

}
